package org.southyin.proxy;

// 代理类
public class Child extends Person {
    // 被代理对象
    private Person person;

    public Child(Person person) {  // Student a  Person b
        this.person = person;
    }

    @Override
    public void test() {
        System.out.println("开启事务");
        person.test();
        System.out.println("结束事务");
    }
}
